<?php
/**
 * 配音接口
 */
require_once dirname(dirname(__DIR__))."/common.php";
use app\cls\tom\Response;
use app\cls\tom\SysResource;
use app\model\UserMaterial;
//实例化数据库
$db = SysResource::getDB(false);
$UserMaterial = new UserMaterial($db);
$da1=$UserMaterial->type_sub(4);
if(!empty($da1)){
    foreach($da1 as $k=>&$v){
        $re=$UserMaterial->ones("video","video_id",["status"=>2,"video_type"=>3,"video_join_sub"=>$v['id']]);
        if(empty($re)){
            unset($da1[$k]);
        }
//        $v['children']=$re;
    }
    $da2=[];
    foreach($da1 as $kk=>$vv){
        $da2[]=$vv;
    }
    Response::output(0,"查询成功",$da2);
}else{
    Response::output(0,"查询成功",[]);
}
//Response::output(0,"查询成功",$da1,count($da1));


